<template>
    <!-- cell单元格的to属性和vueRouter中的routerLink组件的to属性用法是一样的
      :to="'/article/' + article.art_id"
    ES6 :to="`/article/${article.art_id}`" -->
    <van-cell class="articleItem"
    :to="{
      name:'article',
      params:{
        articleId:article.art_id
      }
    }">
      <div slot="title" class="title van-multi-ellipsis--l2">{{ article.title }}</div>
      <div slot="label">
        <div v-if="article.cover.type === 3" class="cover-wrap">
             <div class="cover-item"
               v-for="(wdf,index) in article.cover.images"
                :key="index">
                <van-image
                 class="cover-item-img"
                 fit="cover"
                 :src="wdf"
                />
             </div>
        </div>
        <div class="label-info-wrap">
          <span class="bottom-info">渠梦臣</span>  
          <span class="bottom-info">渠梦臣评论</span>
          <span>{{ article.pubdate | relativeTime }}</span>
        </div>
      </div>
     
        <van-image
          v-if="article.cover.type === 1"
          slot="default"
          class="righe-cover"
          fit="cover"
          :src="article.cover.images[0]"
        />
    
    </van-cell>
</template>

<script>
export default {
  props: {
    article: {
      type: Object,
      required: true,
    },
  },
};
</script>

<style scoped lang="less">
.articleItem{
    .title{
        font-size: 32px;
        color:#3a3a3a;
    }
    .van-cell__value{
        flex:unset;
        width: 232px;
        height: 146px;
        padding-left: 25px;
    }
    .right-cover{
        width: 232px;
        height: 146px;
    }
    .label-info-wrap{
        font-size: 22px;
        color: #b4b4b4;
        .bottom-info{
          padding-right: 25px;
        }
    }
    .cover-wrap{
        display: flex;
        padding: 8px 0;
        .cover-item{
            flex: 1;
            height: 146px;
            &:not(last-child){//不包括最后一个元素
                padding-right: 8px;
            }
            .cover-item-img{
                width: 100%;
                height: 146px;
            }
        }
    }
}
</style>